package khh;

import static org.junit.Assert.assertSame;
import org.junit.Test;

/**
 * The bullet power should be 3 if distance is less than or equal to 100, 2 if distance is between
 * 101 and 500, and 1 if distance is greater than 500.
 * 
 * @author Kylan Hughes
 * @version 1.0
 * 
 */
public class TestKylanFire {
  int dis = 0;
  int firepwr = 0;

  /**
   * Tests the different possibilites that can be passed to the firePower method.
   * Since distance is a value that is calculated within robocode do not need to test
   * for invalid values, instead only for those which return a firepower.
   */
  @Test
  public void testFire() {
    dis = 80;
    firepwr = Kylan.firePower(dis);
    assertSame("Check firepower is 3 when distance is less than 100.", firepwr, 3);
    dis = 180;
    firepwr = Kylan.firePower(dis);
    assertSame("Check firepower is 2 when distance is between 101 and 500.", firepwr, 2);
    dis = 550;
    firepwr = Kylan.firePower(dis);
    assertSame("Check firepower is 1 when distance is greater than 500.", firepwr, 1);
  }
}